Component({
  data: {
    activeTab: 'index',
    list: [{
        value: 'index',
        icon: 'letters-h',
        ariaLabel: '首页'
      },
      {
        value: 'system',
        icon: 'letters-l',
        ariaLabel: '列表'
      },
      {
        value: 'cart',
        icon: 'letters-c',
        ariaLabel: '聊天'
      },
      {
        value: 'mine',
        icon: 'letters-m',
        ariaLabel: '我的'
      },
    ],
  },

  methods: {
    onChange(e) {
      this.setData({
        activeTab: e.detail.value,
      });
      wx.switchTab({
        url: `/pages/${e.detail.value}/index`
      });
    },
  },
});